package com.example.jdimust.historydata;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.example.jdimust.R;

import java.util.List;

/**
 * Author: MaZongyang
 * Date: 2021/5/20/0020 22:12
 * Description:
 */
public class HisDataAdapter extends ArrayAdapter<HisData> {
    private int resourceId;

    public HisDataAdapter(Context context, int textViewResourceId, List<HisData> objects) {

        super(context, textViewResourceId, objects);
        resourceId = textViewResourceId;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        HisData hisdata = getItem(position);
        @SuppressLint("ViewHolder")
        View view9 = LayoutInflater.from(getContext()).inflate(resourceId, parent, false);
        TextView oldver = (TextView) view9.findViewById(R.id.valverkey_lv_ver);
        TextView oldval = (TextView) view9.findViewById(R.id.valverkey_lv_data);
        oldver.setText(hisdata.getVersion());
        oldval.setText(hisdata.getValue());
        return view9;

    }
}
